package cn.tedu.sp12;

public class SingleObject3 {
//双检锁-->懒汉式的基础
    private  static SingleObject3 singleObject3;
    private SingleObject3(){};
    public static SingleObject3 getSingleObject3(){
        if (singleObject3==null){
            synchronized (SingleObject3.class){
                if (singleObject3==null){
                    singleObject3=new SingleObject3();
                }
            }
        }
        return singleObject3;
    }

}

